package cz.data.domain.metadata.model.entity;

import cz.data.common.base.DataScopeBaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import cz.data.common.handlers.ArrayToStringTypeHandler;
import cz.data.domain.metadata.model.dto.DbSchema;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * <p>
 * 数据源信息表
 * </p>
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "metadata_source", autoResultMap = true)
public class MetadataSourceEntity extends DataScopeBaseEntity {
    private static final long serialVersionUID=1L;

    @ApiModelProperty("数据源类型")
    private String dbType;
    @ApiModelProperty("数据源名称")
    private String sourceName;
    @ApiModelProperty(value = "元数据同步", notes = "0否，1同步中, 2是")
    private String isSync;
    @ApiModelProperty("数据源连接信息")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private DbSchema dbSchema;
    @ApiModelProperty(value = "功能集", notes = "enum DataConstant.SourceCapability")
    @TableField(typeHandler = ArrayToStringTypeHandler.class)
    private List<String> capability;
}
